package com.hcs.chenyu;


import android.content.Context;
import android.content.SharedPreferences;

import java.util.HashMap;
import java.util.Map;

public class administrationDatabase  {
    public   static final String FILENAME = "savaInfo";
    public   static final String ACCOUNT = "account";
    public   static final String PASSWORD = "password";
   public static boolean savaUserInfo(Context context,String account,String password){
       SharedPreferences sharedPreferences = context.getSharedPreferences("data",Context.MODE_PRIVATE);
       SharedPreferences.Editor editor = sharedPreferences.edit();
       editor.putString("ACCOUNT",account);
       editor.putString("PASSWORD",password);
       editor.commit();
       return true;
   }
    public static Map<String,String> getUserInfo(Context context){
       SharedPreferences sharedPreferences = context.getSharedPreferences("data",Context.MODE_PRIVATE);
       String account = sharedPreferences.getString("ACCOUNT","");
       String password1 = sharedPreferences.getString("PASSWORD","");
        Map<String,String> userMap = new HashMap<String,String>();
        userMap.put("ACCOUNT",account);
        userMap.put("PASSWORD",password1);
       return userMap;
    }


}
